﻿@model UcAsp.Models.Articles
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>内容管理</title>
    <script type="text/javascript">

        tinymce.init({
            selector: "textarea",
            plugins: [
                "advlist autolink lists link image charmap print preview anchor",
                "searchreplace visualblocks code fullscreen",
                "insertdatetime media table contextmenu paste hr upfile"
            ],
            toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent |link image upfile"

        });
        $(document).ready(function () {
            //$(".editadv").click(function () {
            //    $.post("/admin/GetAdvPostion", { AdvName: $(this).attr("data-id") }, function (dataresult) {
            //        $.facebox(dataresult, "ucaspfacebox");
            //    })
            //});
            $("#savearticle").click(function () {
                $.ajaxFileUpload
                           ({
                               url: '/Admin/UpFile?Path=course',
                               secureuri: false,
                               fileElementId: 'FileImageUrl',
                               dataType: 'json',
                               success: function (data, status) {
                                   if (typeof (data.error) != 'undefined') {
                                       if (data.error != '') {
                                           alert(data.error);
                                       } else {
                                           $.ajaxFileUpload
                                              ({
                                                  url: '/Admin/UpFile?Path=course',
                                                  secureuri: false,
                                                  fileElementId: 'Note1',
                                                  dataType: 'json',
                                                  success: function (message, status) {
                                                      $.post("/ContentManager/SaveContent",
                                                      { ID: $("input[name='ID']").val(), Title: $("input[name='Title']").val(), Note1: message.msg, IconUrl: data.msg, Tag: $("input[name='Tag']").val(), Note2: $("input[name='Note2']").val(), Note3: $("input[name='Note3']").val(), Note4: tinyMCE.get("Note4").getContent(), Note5: tinyMCE.get("Note5").getContent(), Note6: $("input[name='Note6']").val(), Note7: tinyMCE.get("Note7").getContent(), Description: tinyMCE.get("Description").getContent(), ArticleContent: tinyMCE.get("ArticleContent").getContent(), CategorieID: $("select[name='CategorieID']").val(), Rate: $("input[name='Rate']").val(), Note8: $("input[name='Note8']").val(), Note9: $("input[name='Note9']").val() },
                                                      function (dataBack) {
                                                          if (dataBack.Result) {
                                                              location.href = "/teachmanager/coursemanager";
                                                          }
                                                      });
                                                  }
                                              });



                                       }
                                   }
                               },
                               error: function (data, status, e) {
                                   alert(e);
                               }
                           }
                           )




            })
        })

</script>
</head>
<body>
    <form action="#" method="post">
    <div>
        <input name="ID" type="hidden" value="@Model.ID" />
        <p>
              <label>课程名称</label>
              <input class="text-input medium-input" type="text" id="Title" name="Title" value="@Model.Title" />
        </p>
        <p>
              <label>方形图片</label>
              <img alt="" src="@Model.IconUrl" /><input id="FileImageUrl" name="FileImageUrl" type="file" />
        </p>
        <p>
              <label>长条形图片</label>
              <img alt="" src="@Model.Note1" /><input id="Note1" name="Note1" type="file" />
        </p>
         <p>
            <label>分类选择</label>
        @Html.DropDownListFor(m=>m.CategorieID, (SelectList)ViewData["course"])
            </p>
        <p>
              <label>学费</label>
              <input class="text-input medium-input" type="text" id="Note2" name="Note2" value="@Model.Note2" />
        </p>
        <p>
              <label>学时</label>
              <input class="text-input medium-input" type="text" id="Note3" name="Note3" value="@Model.Note3" />
        </p>
        <p>
              <label>一句话介绍</label>
              <input class="text-input medium-input" type="text" id="large-input" name="Tag" value="@Model.Tag" />
        </p>
          <p>
              <label>课程简介</label>
             
              <textarea id="Description" name="Description" cols="20" rows="2">@Model.Description</textarea>
        </p>
        <p>
              <label>授课对象</label>
              
              <textarea id="Note4" name="Note4" cols="20" rows="2">@Model.Note4</textarea>
        </p>
        <p>
              <label>就业方向</label>
             
              <textarea id="Note5" name="Note5" cols="20" rows="2">@Model.Note5</textarea>
        </p>
        <p>
              <label>课程特色</label>
              <input class="text-input large-input" type="text" id="Note6" name="Note6" value="@Model.Note6" />
        </p>
        <p>
              <label>课程大纲</label>
            <textarea id="ArticleContent" name="ArticleContent" cols="20" rows="2">@Model.ArticleContent</textarea>
             
        </p>
        <p>
              <label>其他</label>
              <textarea class="text-input large-input"  id="Note7" name="Note7" >@Model.Note7</textarea>
        </p>
        <p>
              <label>排序</label>
              <input class="text-input medium-input" type="text" id="Rate" name="Rate" value="@Model.Rate" /> 越大排前面
        </p>
        <p>
              <label>培训层次</label>
              <input class="text-input large-input" type="text" id="Note8" name="Note8" value="@Model.Note8" /> 
        </p>
        <p>
              <label>培训形式</label>
              <input class="text-input large-input" type="text" id="Note9" name="Note9" value="@Model.Note9" /> 
        </p>
        <p> 
               <input class="button" id="savearticle" type="button" value=" 保存 " />
      </p>
    </div>
        </form>
</body>
</html>
